package com.mogujie.tt.ui.activity;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

import com.mogujie.tt.R;
import com.mogujie.tt.config.IntentConstant;
import com.mogujie.tt.config.NewFriendsConstant;
import com.mogujie.tt.imservice.manager.IMNewFriendsManager;

/**
 * Created by user on 2015/10/22.
 */
public class SentAddMessageActivity extends Activity {
    private  int friendId;
    private EditText mEditText;
    private Button mButton;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.tt_activity_addmessage);
        mEditText =(EditText)findViewById(R.id.identity_information);
        mButton = (Button)findViewById(R.id.send_button);
        friendId = this.getIntent().getIntExtra(IntentConstant.KEY_PEERID,0);

        mButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                NewFriendsConstant.noNetworkAddBuddy =false;
                IMNewFriendsManager.instance().reqGetAddFriend(mEditText.getText().toString().trim(),friendId);
                Toast.makeText(SentAddMessageActivity.this, "发送添加好友验证", Toast.LENGTH_SHORT).show();
                SentAddMessageActivity.this.finish();
            }
        });
    }
}
